home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 January: Mac OS SDK / Dev.CD Jan 99 SDK1.toast / Development Kits / Interfaces&Libraries / Universal / Interfaces / AIncludes / PictUtils.a < prev    next >
Encoding:
Text File  |  1998-08-17  |  7.3 KB  |  210 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        PictUtils.a
  3. ;
  4. ;    Contains:    Picture Utilities Interfaces.
  5. ;
  6. ;    Version:    Technology:    System 7.5
  7. ;                Release:    Universal Interfaces 3.2
  8. ;
  9. ;    Copyright:    © 1990-1998 by Apple Computer, Inc., all rights reserved
  10. ;
  11. ;    Bugs?:        For bug reports, consult the following page on
  12. ;                the World Wide Web:
  13. ;
  14. ;                    http://developer.apple.com/bugreporter/
  15. ;
  16. ;
  17.     IF &TYPE('__PICTUTILS__') = 'UNDEFINED' THEN
  18. __PICTUTILS__ SET 1
  19.  
  20.     IF &TYPE('__MACTYPES__') = 'UNDEFINED' THEN
  21.     include 'MacTypes.a'
  22.     ENDIF
  23.     IF &TYPE('__PALETTES__') = 'UNDEFINED' THEN
  24.     include 'Palettes.a'
  25.     ENDIF
  26.  
  27. ;  verbs for the GetPictInfo, GetPixMapInfo, and NewPictInfo calls 
  28.  
  29. returnColorTable                EQU        $0001
  30. returnPalette                    EQU        $0002
  31. recordComments                    EQU        $0004
  32. recordFontInfo                    EQU        $0008
  33. suppressBlackAndWhite            EQU        $0010
  34.  
  35.                                                             ; color pick methods 
  36. systemMethod                    EQU        0                    ; system color pick method 
  37. popularMethod                    EQU        1                    ; method that chooses the most popular set of colors 
  38. medianMethod                    EQU        2                    ; method that chooses a good average mix of colors 
  39.                                                             ; color bank types 
  40. ColorBankIsCustom                EQU        -1
  41. ColorBankIsExactAnd555            EQU        0
  42. ColorBankIs555                    EQU        1
  43. ; typedef long                             PictInfoID
  44.  
  45. CommentSpec                RECORD 0
  46. count                     ds.w    1                ; offset: $0 (0)        ;  number of occurrances of this comment ID 
  47. ID                         ds.w    1                ; offset: $2 (2)        ;  ID for the comment in the picture 
  48. sizeof                     EQU *                    ; size:   $4 (4)
  49.                         ENDR
  50. ; typedef struct CommentSpec *            CommentSpecPtr
  51.  
  52. ; typedef CommentSpecPtr *                CommentSpecHandle
  53.  
  54. FontSpec                RECORD 0
  55. pictFontID                 ds.w    1                ; offset: $0 (0)        ;  ID of the font in the picture 
  56. sysFontID                 ds.w    1                ; offset: $2 (2)        ;  ID of the same font in the current system file 
  57. size                     ds.l    4                ; offset: $4 (4)        ;  bit array of all the sizes found (1..127) (bit 0 means > 127) 
  58. style                     ds.w    1                ; offset: $14 (20)        ;  combined style of all occurrances of the font 
  59. nameOffset                 ds.l    1                ; offset: $16 (22)        ;  offset into the fontNamesHdl handle for the font’s name 
  60. sizeof                     EQU *                    ; size:   $1A (26)
  61.                         ENDR
  62. ; typedef struct FontSpec *                FontSpecPtr
  63.  
  64. ; typedef FontSpecPtr *                    FontSpecHandle
  65.  
  66. PictInfo                RECORD 0
  67. version                     ds.w    1                ; offset: $0 (0)        ;  this is always zero, for now 
  68. uniqueColors             ds.l    1                ; offset: $2 (2)        ;  the number of actual colors in the picture(s)/pixmap(s) 
  69. thePalette                 ds.l    1                ; offset: $6 (6)        ;  handle to the palette information 
  70. theColorTable             ds.l    1                ; offset: $A (10)        ;  handle to the color table 
  71. hRes                     ds.l    1                ; offset: $E (14)        ;  maximum horizontal resolution for all the pixmaps 
  72. vRes                     ds.l    1                ; offset: $12 (18)        ;  maximum vertical resolution for all the pixmaps 
  73. depth                     ds.w    1                ; offset: $16 (22)        ;  maximum depth for all the pixmaps (in the picture) 
  74. sourceRect                 ds        Rect            ; offset: $18 (24)        ;  the picture frame rectangle (this contains the entire picture) 
  75. textCount                 ds.l    1                ; offset: $20 (32)        ;  total number of text strings in the picture 
  76. lineCount                 ds.l    1                ; offset: $24 (36)        ;  total number of lines in the picture 
  77. rectCount                 ds.l    1                ; offset: $28 (40)        ;  total number of rectangles in the picture 
  78. rRectCount                 ds.l    1                ; offset: $2C (44)        ;  total number of round rectangles in the picture 
  79. ovalCount                 ds.l    1                ; offset: $30 (48)        ;  total number of ovals in the picture 
  80. arcCount                 ds.l    1                ; offset: $34 (52)        ;  total number of arcs in the picture 
  81. polyCount                 ds.l    1                ; offset: $38 (56)        ;  total number of polygons in the picture 
  82. regionCount                 ds.l    1                ; offset: $3C (60)        ;  total number of regions in the picture 
  83. bitMapCount                 ds.l    1                ; offset: $40 (64)        ;  total number of bitmaps in the picture 
  84. pixMapCount                 ds.l    1                ; offset: $44 (68)        ;  total number of pixmaps in the picture 
  85. commentCount             ds.l    1                ; offset: $48 (72)        ;  total number of comments in the picture 
  86. uniqueComments             ds.l    1                ; offset: $4C (76)        ;  the number of unique comments in the picture 
  87. commentHandle             ds.l    1                ; offset: $50 (80)        ;  handle to all the comment information 
  88. uniqueFonts                 ds.l    1                ; offset: $54 (84)        ;  the number of unique fonts in the picture 
  89. fontHandle                 ds.l    1                ; offset: $58 (88)        ;  handle to the FontSpec information 
  90. fontNamesHandle             ds.l    1                ; offset: $5C (92)        ;  handle to the font names 
  91. reserved1                 ds.l    1                ; offset: $60 (96)
  92. reserved2                 ds.l    1                ; offset: $64 (100)
  93. sizeof                     EQU *                    ; size:   $68 (104)
  94.                         ENDR
  95. ; typedef struct PictInfo *                PictInfoPtr
  96.  
  97. ; typedef PictInfoPtr *                    PictInfoHandle
  98.  
  99. ;
  100. ; pascal OSErr GetPictInfo(PicHandle thePictHandle, PictInfo *thePictInfo, short verb, short colorsRequested, short colorPickMethod, short version)
  101. ;
  102.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  103.         Macro
  104.         _GetPictInfo
  105.             move.w              #$0800,D0
  106.             dc.w                $A831
  107.         EndM
  108.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  109.         IMPORT_CFM_FUNCTION GetPictInfo
  110.     ENDIF
  111.  
  112. ;
  113. ; pascal OSErr GetPixMapInfo(PixMapHandle thePixMapHandle, PictInfo *thePictInfo, short verb, short colorsRequested, short colorPickMethod, short version)
  114. ;
  115.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  116.         Macro
  117.         _GetPixMapInfo
  118.             move.w              #$0801,D0
  119.             dc.w                $A831
  120.         EndM
  121.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  122.         IMPORT_CFM_FUNCTION GetPixMapInfo
  123.     ENDIF
  124.  
  125. ;
  126. ; pascal OSErr NewPictInfo(PictInfoID *thePictInfoID, short verb, short colorsRequested, short colorPickMethod, short version)
  127. ;
  128.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  129.         Macro
  130.         _NewPictInfo
  131.             move.w              #$0602,D0
  132.             dc.w                $A831
  133.         EndM
  134.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  135.         IMPORT_CFM_FUNCTION NewPictInfo
  136.     ENDIF
  137.  
  138. ;
  139. ; pascal OSErr RecordPictInfo(PictInfoID thePictInfoID, PicHandle thePictHandle)
  140. ;
  141.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  142.         Macro
  143.         _RecordPictInfo
  144.             move.w              #$0403,D0
  145.             dc.w                $A831
  146.         EndM
  147.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  148.         IMPORT_CFM_FUNCTION RecordPictInfo
  149.     ENDIF
  150.  
  151. ;
  152. ; pascal OSErr RecordPixMapInfo(PictInfoID thePictInfoID, PixMapHandle thePixMapHandle)
  153. ;
  154.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  155.         Macro
  156.         _RecordPixMapInfo
  157.             move.w              #$0404,D0
  158.             dc.w                $A831
  159.         EndM
  160.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  161.         IMPORT_CFM_FUNCTION RecordPixMapInfo
  162.     ENDIF
  163.  
  164. ;
  165. ; pascal OSErr RetrievePictInfo(PictInfoID thePictInfoID, PictInfo *thePictInfo, short colorsRequested)
  166. ;
  167.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  168.         Macro
  169.         _RetrievePictInfo
  170.             move.w              #$0505,D0
  171.             dc.w                $A831
  172.         EndM
  173.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  174.         IMPORT_CFM_FUNCTION RetrievePictInfo
  175.     ENDIF
  176.  
  177. ;
  178. ; pascal OSErr DisposePictInfo(PictInfoID thePictInfoID)
  179. ;
  180.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  181.         Macro
  182.         _DisposePictInfo
  183.             move.w              #$0206,D0
  184.             dc.w                $A831
  185.         EndM
  186.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  187.         IMPORT_CFM_FUNCTION DisposePictInfo
  188.     ENDIF
  189.  
  190.     IF OLDROUTINENAMES THEN
  191. ;
  192. ; pascal OSErr DisposPictInfo(PictInfoID thePictInfoID)
  193. ;
  194.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  195.         Macro
  196.         _DisposPictInfo
  197.             move.w              #$0206,D0
  198.             dc.w                $A831
  199.         EndM
  200.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  201.         IMPORT_CFM_FUNCTION DisposPictInfo
  202.     ENDIF
  203.  
  204.     ENDIF    ; OLDROUTINENAMES
  205.  
  206.  
  207.  
  208.     ENDIF ; __PICTUTILS__ 
  209.  
  210.